package cn.edu.lcu.cs.javateaching.oop;

import java.io.Serializable;
import java.time.LocalDate;

/**
 * 实体类，实现了Serializable，可以被序列化
 * 
 * @author Ling
 *
 */
public class User implements Serializable {
	private Long id;
	private String name;
	private String password;
	private String realName;
	private transient LocalDate birthdate; // transient 字段不被序列化

	@Override
	public String toString() {
		return "{id:" + id + ", name:" + name + ", password:" + password + ", realName:" + realName + ", birthdate:" + birthdate + "}";
	}

	public Long getId() {
		return id;
	}

	public User(String name, String password, String realName) {
		super();
		this.name = name;
		this.password = password;
		this.realName = realName;
	}

	public void setId(Long id) {
		this.id = id;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public String getPassword() {
		return password;
	}

	public void setPassword(String password) {
		this.password = password;
	}

	public String getRealName() {
		return realName;
	}

	public void setRealName(String realName) {
		this.realName = realName;
	}

	public User(Long id, String name, String password, String realName) {
		super();
		this.id = id;
		this.name = name;
		this.password = password;
		this.realName = realName;
	}

	public User() {
	}

	public User(Long id, String name, String password, String realName, LocalDate birthdate) {
		super();
		this.id = id;
		this.name = name;
		this.password = password;
		this.realName = realName;
		this.birthdate = birthdate;
	}

	public LocalDate getBirthdate() {
		return birthdate;
	}

	public void setBirthdate(LocalDate birthdate) {
		this.birthdate = birthdate;
	}

}
